<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-169911533-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-169911533-1');
</script>

  

  
  <title>CDH Hadoop安装过程 | 空城盼故人</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="google-site-verification" content="NOVpqBhVVjZHOamocUf3Grijt7xAK_Engoe_FNrxE3Q" />
  <meta name="baidu-site-verification" content="HBrapLOndy" />
  
  <meta name="keywords" content="许嵩老公" />
  
  <meta name="description" content="1. 安装环境 操作系统：Ubuntu 18.04 64位 Hadoop版本：hadoop-2.6.0-cdh5.7.0.tar.gz JDK版本：jdk-8u241-linux-x64.tar.gz  2. Hadoop伪分布式安装操作环境：macOS终端 ssh 远程连接Ubuntu   2.1. 下载地址12wget https:&#x2F;&#x2F;archive.cloudera.com&#x2F;cdh5&#x2F;cdh">
<meta property="og:type" content="article">
<meta property="og:title" content="CDH Hadoop安装过程">
<meta property="og:url" content="https://xiaoyan94.github.io/2020/06/08/CDH-Hadoop%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B/index.html">
<meta property="og:site_name" content="空城盼故人">
<meta property="og:description" content="1. 安装环境 操作系统：Ubuntu 18.04 64位 Hadoop版本：hadoop-2.6.0-cdh5.7.0.tar.gz JDK版本：jdk-8u241-linux-x64.tar.gz  2. Hadoop伪分布式安装操作环境：macOS终端 ssh 远程连接Ubuntu   2.1. 下载地址12wget https:&#x2F;&#x2F;archive.cloudera.com&#x2F;cdh5&#x2F;cdh">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoyan94.github.io/2020/06/08/CDH-Hadoop%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B/hdfs01.png">
<meta property="og:image" content="https://xiaoyan94.github.io/2020/06/08/CDH-Hadoop%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B/hdfs02.png">
<meta property="article:published_time" content="2020-06-08T10:56:47.000Z">
<meta property="article:modified_time" content="2020-06-18T10:53:14.244Z">
<meta property="article:author" content="许嵩老公">
<meta property="article:tag" content="Hadoop">
<meta property="article:tag" content="安装教程">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoyan94.github.io/2020/06/08/CDH-Hadoop%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B/hdfs01.png">
  
    <link rel="alternate" href="../../../../atom.xml" title="空城盼故人" type="application/atom+xml">
  
  
    <link rel="icon" href="https://q1.qlogo.cn/g?b=qq&nk=979727728&s=640">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="../../../../css/style.css">

  
<link rel="stylesheet" href="../../../../css/highlight.css">

<meta name="generator" content="Hexo 4.2.1"></head>

<body>
  <div id="fullpage" class="mobile-nav-right">
    <div class="fixed"></div>
    
      <div id="wrapper">
    
    
      <header id="header">
  <div id="nav-toggle" class="nav-toggle"></div>
  <div class="head-box global-width">
    <nav class="nav-box nav-right">
      
        <a class="nav-item" href="../../../../index.html" title
        
        >首页</a>
      
        <a class="nav-item" href="../../../../archives" title
        
        >归档</a>
      
        <a class="nav-item" href="../../../../quick-notes" title
        
        >小抄</a>
      
        <a class="nav-item" href="../../../../about" title
        
        >关于</a>
      
    </nav>
  </div>
</header>
      <div id="middlecontent" title class="global-width sidebar-right">
        <section id="main"><article id="post-CDH-Hadoop安装过程" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 class="article-title" itemprop="name">
      CDH Hadoop安装过程
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="" class="article-date">
  <time datetime="2020-06-08T10:56:47.000Z" itemprop="datePublished">2020-06-08</time>
</a>
    
    
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="../../../../tags/Hadoop/" rel="tag">Hadoop</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="../../../../tags/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/" rel="tag">安装教程</a></li></ul>

  </div>
  
    <span id="busuanzi_container_page_pv">
      本文总阅读量<span id="busuanzi_value_page_pv"></span>次
    </span>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud" itemprop="articleBody">
      
        
        <h2 id="1-安装环境"><a href="#1-安装环境" class="headerlink" title="1. 安装环境"></a>1. 安装环境</h2><ul>
<li>操作系统：Ubuntu 18.04 64位</li>
<li><a href="https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html" target="_blank" rel="noopener">Hadoop</a>版本：hadoop-2.6.0-cdh5.7.0.tar.gz</li>
<li>JDK版本：jdk-8u241-linux-x64.tar.gz</li>
</ul>
<h2 id="2-Hadoop伪分布式安装"><a href="#2-Hadoop伪分布式安装" class="headerlink" title="2. Hadoop伪分布式安装"></a>2. <a href="https://archive.cloudera.com/cdh5/cdh/5/hadoop-2.6.0-cdh5.7.0/hadoop-project-dist/hadoop-common/SingleCluster.html" target="_blank" rel="noopener">Hadoop伪分布式安装</a></h2><p>操作环境：macOS终端 <code>ssh</code> 远程连接Ubuntu  </p>
<h3 id="2-1-下载地址"><a href="#2-1-下载地址" class="headerlink" title="2.1. 下载地址"></a>2.1. 下载地址</h3><div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">wget https://archive.cloudera.com/cdh5/cdh/5/hadoop-2.6.0-cdh5.7.0.tar.gz <span class="comment">#Hadoop安装包</span></span><br><span class="line">wget http://enos.itcollege.ee/~jpoial/allalaadimised/jdk8/jdk-8u241-linux-x64.tar.gz <span class="comment">#JDK安装包</span></span><br></pre></td></tr></table></figure></div>

<a id="more"></a>

<h3 id="2-2-JDK安装"><a href="#2-2-JDK安装" class="headerlink" title="2.2. JDK安装"></a>2.2. JDK安装</h3><div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">tar -xvzf jdk-8u241-linux-x64.tar.gz -C ~/app <span class="comment">#解压到~/app目录下</span></span><br><span class="line">vi ~/.bash_profile <span class="comment">#设置系统环境变量</span></span><br></pre></td></tr></table></figure></div>

<p>vi编辑器添加以下内容</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">export</span> JAVA_HOME=/root/app/jdk1.8.0_241</span><br><span class="line"><span class="built_in">export</span> PATH=<span class="variable">$JAVA_HOME</span>/bin:<span class="variable">$PATH</span></span><br></pre></td></tr></table></figure></div>

<p>生效环境变量</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">source</span> ~/.bash_profile</span><br><span class="line">java -version</span><br></pre></td></tr></table></figure></div>

<h3 id="2-3-Hadoop安装"><a href="#2-3-Hadoop安装" class="headerlink" title="2.3. Hadoop安装"></a>2.3. Hadoop安装</h3><div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">apt install rsync</span><br><span class="line">apt install ssh</span><br><span class="line">ssh-keygen -t rsa</span><br><span class="line">cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys</span><br><span class="line">ssh localhost -p 26885 <span class="comment">#不用输入密码就能连接上了</span></span><br><span class="line">tar -zxvf hadoop-2.6.0-cdh5.7.0.tar.gz -C ~/app/ <span class="comment">#解压hadoop</span></span><br></pre></td></tr></table></figure></div>

<h3 id="2-4-Hadoop配置"><a href="#2-4-Hadoop配置" class="headerlink" title="2.4. Hadoop配置"></a>2.4. Hadoop配置</h3><div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vi app/hadoop-2.6.0-cdh5.7.0/etc/hadoop/hadoop-env.sh</span><br></pre></td></tr></table></figure></div>

<p>配置<code>hadoop-env.sh</code>文件，修改JAVA_HOME；如果ssh端口不是默认的22则设置ssh端口</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">export</span> JAVA_HOME=/root/app/jdk1.8.0_241</span><br><span class="line"><span class="built_in">export</span> HADOOP_SSH_OPTS=<span class="string">"-p 26885"</span></span><br></pre></td></tr></table></figure></div>

<blockquote>
<p>如果控制台出现错误提示：Hadoop: connect to host localhost port 22: Connection refused when running start-dfs.sh<br>那么可能的原因是ssh端口不是默认的22。需要在<code>hadoop安装目录</code>&#x2F;etc&#x2F;hadoop&#x2F;hadoop-env.sh中添加<code>export HADOOP_SSH_OPTS=&quot;-p 26885&quot;</code>，其中-p后面的参数是当前ssh使用的端口号  </p>
</blockquote>
<p>配置<code>core-site.xml</code>,端口改为8020,配置<code>hadoop.tmp.dir</code>临时文件目录，因为默认为Linux临时目录每次重启都会清空</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="XML"><figure class="iseeu highlight /xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">configuration</span>&gt;</span></span><br><span class="line">   <span class="tag">&lt;<span class="name">property</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">name</span>&gt;</span>fs.defaultFS<span class="tag">&lt;/<span class="name">name</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">value</span>&gt;</span>hdfs://ip:8020<span class="tag">&lt;/<span class="name">value</span>&gt;</span></span><br><span class="line">   <span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">   <span class="tag">&lt;<span class="name">property</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">name</span>&gt;</span>hadoop.tmp.dir<span class="tag">&lt;/<span class="name">name</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">value</span>&gt;</span>/home/root/app/tmp<span class="tag">&lt;/<span class="name">value</span>&gt;</span></span><br><span class="line">   <span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">configuration</span>&gt;</span></span><br></pre></td></tr></table></figure></div>

<p>上面的配置中，需要通过JavaAPI远程操作则ip不能配置为localhost，需要公网ip。</p>
<p>配置<code>hdfs-site.xml</code></p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="XML"><figure class="iseeu highlight /xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">configuration</span>&gt;</span></span><br><span class="line">   <span class="tag">&lt;<span class="name">property</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">name</span>&gt;</span>dfs.replication<span class="tag">&lt;/<span class="name">name</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">value</span>&gt;</span>1<span class="tag">&lt;/<span class="name">value</span>&gt;</span></span><br><span class="line">   <span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">configuration</span>&gt;</span></span><br></pre></td></tr></table></figure></div>

<hr>
<h3 id="2-5-启动HDFS"><a href="#2-5-启动HDFS" class="headerlink" title="2.5. 启动HDFS"></a>2.5. 启动HDFS</h3><p>格式化文件系统（仅仅第一次需要执行格式化）</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">bin/hdfs namenode -format</span><br></pre></td></tr></table></figure></div>

<p>启动hdfs</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sbin/start-dfs.sh</span><br></pre></td></tr></table></figure></div>

<p>验证是否启动成功</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">jps</span><br></pre></td></tr></table></figure></div>

<p>如果有以下java进程，说明启动成功</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/app/hadoop-2.6.0-cdh5.7.0<span class="comment"># jps</span></span><br><span class="line">5745 Jps</span><br><span class="line">5330 NameNode</span><br><span class="line">5641 SecondaryNameNode</span><br><span class="line">5439 DataNode</span><br></pre></td></tr></table></figure></div>
<blockquote>
<ul>
<li>也可以通过浏览器访问 <a href="http://localhost:50070/" target="_blank" rel="noopener">http://localhost:50070</a>（本地服务器），<a href="http://ip:50070/" target="_blank" rel="noopener">http://ip:50070/</a>（远程服务器）  <ul>
<li>如果浏览器打不开 HADOOP WEB 页面，请配置防火墙开放 <strong>50070</strong> 端口。Ubuntu可以使用 <code>ufw</code> 命令配置防火墙。</li>
</ul>
</li>
<li><code>jps</code> 命令是JDK 1.5之后自带的查看Java进程的指令。</li>
</ul>
</blockquote>
<h3 id="2-6-停止HDFS"><a href="#2-6-停止HDFS" class="headerlink" title="2.6. 停止HDFS"></a>2.6. 停止HDFS</h3><div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/app/hadoop-2.6.0-cdh5.7.0<span class="comment"># sbin/stop-dfs.sh</span></span><br><span class="line">20/06/08 09:18:17 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">Stopping namenodes on [localhost]</span><br><span class="line">localhost: stopping namenode</span><br><span class="line">localhost: stopping datanode</span><br><span class="line">Stopping secondary namenodes [0.0.0.0]</span><br><span class="line">0.0.0.0: stopping secondarynamenode</span><br><span class="line">20/06/08 09:18:39 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/app/hadoop-2.6.0-cdh5.7.0<span class="comment">#</span></span><br><span class="line">root@brave-post-2:~/app/hadoop-2.6.0-cdh5.7.0<span class="comment"># jps # 再次输入jps查看Java进程，hdfs已经停止</span></span><br><span class="line">6943 Jps</span><br><span class="line">root@brave-post-2:~/app/hadoop-2.6.0-cdh5.7.0<span class="comment">#</span></span><br></pre></td></tr></table></figure></div>

<hr>
<h2 id="3-HDFS-SHELL-常用命令"><a href="#3-HDFS-SHELL-常用命令" class="headerlink" title="3. HDFS SHELL 常用命令"></a>3. HDFS SHELL 常用命令</h2><h3 id="3-1-将Hadoop-bin目录添加到环境变量"><a href="#3-1-将Hadoop-bin目录添加到环境变量" class="headerlink" title="3.1. 将Hadoop bin目录添加到环境变量"></a>3.1. 将Hadoop bin目录添加到环境变量</h3><div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vi ~/.bash_profile <span class="comment">#设置系统环境变量</span></span><br></pre></td></tr></table></figure></div>

<p>vi 编辑器添加以下内容</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">export</span> HADOOP_HOME=/root/app/hadoop-2.6.0-cdh5.7.0</span><br><span class="line"><span class="built_in">export</span> PATH=<span class="variable">$HADOOP_HOME</span>/bin:<span class="variable">$PATH</span></span><br></pre></td></tr></table></figure></div>

<p>生效环境变量</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/app/hadoop-2.6.0-cdh5.7.0<span class="comment"># vi ~/.bash_profile</span></span><br><span class="line">root@brave-post-2:~/app/hadoop-2.6.0-cdh5.7.0<span class="comment"># source ~/.bash_profile</span></span><br></pre></td></tr></table></figure></div>

<p>终端键入<code>hdfs</code>，若有输出hdfs命令的用法提示则环境变量配置成功。</p>
<h3 id="3-2-HDFS-SHELL-命令用法"><a href="#3-2-HDFS-SHELL-命令用法" class="headerlink" title="3.2. HDFS SHELL 命令用法"></a>3.2. HDFS SHELL 命令用法</h3><div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/app/hadoop-2.6.0-cdh5.7.0<span class="comment"># hdfs</span></span><br><span class="line">   Usage: hdfs [--config confdir] COMMAND</span><br><span class="line">      <span class="built_in">where</span> COMMAND is one of:</span><br><span class="line">   dfs                  run a filesystem <span class="built_in">command</span> on the file systems supported <span class="keyword">in</span> Hadoop.</span><br><span class="line">   namenode -format     format the DFS filesystem</span><br><span class="line">   secondarynamenode    run the DFS secondary namenode</span><br><span class="line">   namenode             run the DFS namenode</span><br><span class="line">   journalnode          run the DFS journalnode</span><br><span class="line">   zkfc                 run the ZK Failover Controller daemon</span><br><span class="line">   datanode             run a DFS datanode</span><br><span class="line">   dfsadmin             run a DFS admin client</span><br><span class="line">   haadmin              run a DFS HA admin client</span><br><span class="line">   fsck                 run a DFS filesystem checking utility</span><br><span class="line">   balancer             run a cluster balancing utility</span><br><span class="line">   jmxget               get JMX exported values from NameNode or DataNode.</span><br><span class="line">   mover                run a utility to move block replicas across</span><br><span class="line">                     storage types</span><br><span class="line">   oiv                  apply the offline fsimage viewer to an fsimage</span><br><span class="line">   oiv_legacy           apply the offline fsimage viewer to an legacy fsimage</span><br><span class="line">   oev                  apply the offline edits viewer to an edits file</span><br><span class="line">   fetchdt              fetch a delegation token from the NameNode</span><br><span class="line">   getconf              get config values from configuration</span><br><span class="line">   groups               get the groups <span class="built_in">which</span> users belong to</span><br><span class="line">   snapshotDiff         diff two snapshots of a directory or diff the</span><br><span class="line">                     current directory contents with a snapshot</span><br><span class="line">   lsSnapshottableDir   list all snapshottable <span class="built_in">dirs</span> owned by the current user</span><br><span class="line">                     Use -<span class="built_in">help</span> to see options</span><br><span class="line">   portmap              run a portmap service</span><br><span class="line">   nfs3                 run an NFS version 3 gateway</span><br><span class="line">   cacheadmin           configure the HDFS cache</span><br><span class="line">   crypto               configure HDFS encryption zones</span><br><span class="line">   storagepolicies      list/get/<span class="built_in">set</span> block storage policies</span><br><span class="line">   version              <span class="built_in">print</span> the version</span><br><span class="line"></span><br><span class="line">   Most commands <span class="built_in">print</span> <span class="built_in">help</span> when invoked w/o parameters.</span><br><span class="line">root@brave-post-2:~/app/hadoop-2.6.0-cdh5.7.0<span class="comment">#</span></span><br><span class="line"></span><br><span class="line">root@brave-post-2:~<span class="comment"># hdfs dfs</span></span><br><span class="line">Usage: hadoop fs [generic options]  <span class="comment">#也可以使用Hadoop fs命令</span></span><br><span class="line">   [-appendToFile &lt;localsrc&gt; ... &lt;dst&gt;]</span><br><span class="line">   [-cat [-ignoreCrc] &lt;src&gt; ...]</span><br><span class="line">   [-checksum &lt;src&gt; ...]</span><br><span class="line">   [-chgrp [-R] GROUP PATH...]</span><br><span class="line">   [-chmod [-R] &lt;MODE[,MODE]... | OCTALMODE&gt; PATH...]</span><br><span class="line">   [-chown [-R] [OWNER][:[GROUP]] PATH...]</span><br><span class="line">   [-copyFromLocal [-f] [-p] [-l] &lt;localsrc&gt; ... &lt;dst&gt;]</span><br><span class="line">   [-copyToLocal [-p] [-ignoreCrc] [-crc] &lt;src&gt; ... &lt;localdst&gt;]</span><br><span class="line">   [-count [-q] [-h] [-v] &lt;path&gt; ...]</span><br><span class="line">   [-cp [-f] [-p | -p[topax]] &lt;src&gt; ... &lt;dst&gt;]</span><br><span class="line">   [-createSnapshot &lt;snapshotDir&gt; [&lt;snapshotName&gt;]]</span><br><span class="line">   [-deleteSnapshot &lt;snapshotDir&gt; &lt;snapshotName&gt;]</span><br><span class="line">   [-df [-h] [&lt;path&gt; ...]]</span><br><span class="line">   [-du [-s] [-h] &lt;path&gt; ...]</span><br><span class="line">   [-expunge]</span><br><span class="line">   [-find &lt;path&gt; ... &lt;expression&gt; ...]</span><br><span class="line">   [-get [-p] [-ignoreCrc] [-crc] &lt;src&gt; ... &lt;localdst&gt;]</span><br><span class="line">   [-getfacl [-R] &lt;path&gt;]</span><br><span class="line">   [-getfattr [-R] &#123;-n name | -d&#125; [-e en] &lt;path&gt;]</span><br><span class="line">   [-getmerge [-nl] &lt;src&gt; &lt;localdst&gt;]</span><br><span class="line">   [-<span class="built_in">help</span> [cmd ...]]</span><br><span class="line">   [-ls [-d] [-h] [-R] [&lt;path&gt; ...]]</span><br><span class="line">   [-mkdir [-p] &lt;path&gt; ...]</span><br><span class="line">   [-moveFromLocal &lt;localsrc&gt; ... &lt;dst&gt;]</span><br><span class="line">   [-moveToLocal &lt;src&gt; &lt;localdst&gt;]</span><br><span class="line">   [-mv &lt;src&gt; ... &lt;dst&gt;]</span><br><span class="line">   [-put [-f] [-p] [-l] &lt;localsrc&gt; ... &lt;dst&gt;]</span><br><span class="line">   [-renameSnapshot &lt;snapshotDir&gt; &lt;oldName&gt; &lt;newName&gt;]</span><br><span class="line">   [-rm [-f] [-r|-R] [-skipTrash] &lt;src&gt; ...]</span><br><span class="line">   [-rmdir [--ignore-fail-on-non-empty] &lt;dir&gt; ...]</span><br><span class="line">   [-setfacl [-R] [&#123;-b|-k&#125; &#123;-m|-x &lt;acl_spec&gt;&#125; &lt;path&gt;]|[--<span class="built_in">set</span> &lt;acl_spec&gt; &lt;path&gt;]]</span><br><span class="line">   [-setfattr &#123;-n name [-v value] | -x name&#125; &lt;path&gt;]</span><br><span class="line">   [-setrep [-R] [-w] &lt;rep&gt; &lt;path&gt; ...]</span><br><span class="line">   [-<span class="built_in">stat</span> [format] &lt;path&gt; ...]</span><br><span class="line">   [-tail [-f] &lt;file&gt;]</span><br><span class="line">   [-<span class="built_in">test</span> -[defsz] &lt;path&gt;]</span><br><span class="line">   [-text [-ignoreCrc] &lt;src&gt; ...]</span><br><span class="line">   [-touchz &lt;path&gt; ...]</span><br><span class="line">   [-usage [cmd ...]]</span><br><span class="line"></span><br><span class="line">Generic options supported are</span><br><span class="line">-conf &lt;configuration file&gt;     specify an application configuration file</span><br><span class="line">-D &lt;property=value&gt;            use value <span class="keyword">for</span> given property</span><br><span class="line">-fs &lt;<span class="built_in">local</span>|namenode:port&gt;      specify a namenode</span><br><span class="line">-jt &lt;<span class="built_in">local</span>|resourcemanager:port&gt;    specify a ResourceManager</span><br><span class="line">-files &lt;comma separated list of files&gt;    specify comma separated files to be copied to the map reduce cluster</span><br><span class="line">-libjars &lt;comma separated list of jars&gt;    specify comma separated jar files to include <span class="keyword">in</span> the classpath.</span><br><span class="line">-archives &lt;comma separated list of archives&gt;    specify comma separated archives to be unarchived on the compute machines.</span><br><span class="line"></span><br><span class="line">The general <span class="built_in">command</span> line syntax is</span><br><span class="line">bin/hadoop <span class="built_in">command</span> [genericOptions] [commandOptions]</span><br><span class="line"></span><br><span class="line">root@brave-post-2:~<span class="comment">#</span></span><br></pre></td></tr></table></figure></div>

<hr>
<h3 id="3-3-ls、put命令"><a href="#3-3-ls、put命令" class="headerlink" title="3.3. ls、put命令"></a>3.3. <code>ls</code>、<code>put</code>命令</h3><ul>
<li>查看目录列表 <code>ls</code>  </li>
<li>将本地文件保存到HDFS中 <code>put</code></li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~<span class="comment"># mkdir ~/data</span></span><br><span class="line">root@brave-post-2:~<span class="comment"># cd ~/data</span></span><br><span class="line">root@brave-post-2:~/data<span class="comment"># ls</span></span><br><span class="line">root@brave-post-2:~/data<span class="comment"># vi hello.txt</span></span><br><span class="line">root@brave-post-2:~/data<span class="comment"># cat hello.txt</span></span><br><span class="line">hadoop welcome</span><br><span class="line">hadoop hdfs</span><br><span class="line">hadoop hello</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -ls /</span></span><br><span class="line">20/06/08 21:59:27 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">ls: Call From localhost/127.0.0.1 to localhost:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># $HADOOP_HOME/sbin/start-dfs.sh</span></span><br><span class="line">20/06/08 22:02:12 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">Starting namenodes on [localhost]</span><br><span class="line">localhost: starting namenode, logging to /root/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-root-namenode-brave-post-2.localdomain.out</span><br><span class="line">localhost: starting datanode, logging to /root/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-root-datanode-brave-post-2.localdomain.out</span><br><span class="line">Starting secondary namenodes [0.0.0.0]</span><br><span class="line">0.0.0.0: starting secondarynamenode, logging to /root/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-root-secondarynamenode-brave-post-2.localdomain.out</span><br><span class="line">20/06/08 22:02:31 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -ls /  #没有文件</span></span><br><span class="line">20/06/08 22:02:36 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -put hello.txt /</span></span><br><span class="line">20/06/08 22:03:08 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -ls /  #有了hello.txt</span></span><br><span class="line">20/06/08 22:03:30 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">Found 1 items</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:03 /hello.txt</span><br></pre></td></tr></table></figure></div>

<hr>
<h3 id="3-4-查看文件内容-text、cat"><a href="#3-4-查看文件内容-text、cat" class="headerlink" title="3.4. 查看文件内容  text、cat"></a>3.4. 查看文件内容  <code>text</code>、<code>cat</code></h3><div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -text /hello.txt</span></span><br><span class="line">20/06/08 22:08:59 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">hadoop welcome</span><br><span class="line">hadoop hdfs</span><br><span class="line">hadoop hello</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -cat /hello.txt</span></span><br><span class="line">20/06/08 22:09:11 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">hadoop welcome</span><br><span class="line">hadoop hdfs</span><br><span class="line">hadoop hello</span><br><span class="line">root@brave-post-2:~/data<span class="comment">#</span></span><br></pre></td></tr></table></figure></div>

<hr>
<h3 id="3-5-mkdir、rmdir、get、copyFromLocal、rm"><a href="#3-5-mkdir、rmdir、get、copyFromLocal、rm" class="headerlink" title="3.5. mkdir、rmdir、get、copyFromLocal、rm"></a>3.5. <code>mkdir、rmdir、get、copyFromLocal、rm</code></h3><ul>
<li>创建目录 <code>mkdir</code></li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -mkdir /testdir</span></span><br><span class="line">20/06/08 22:13:56 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs  -ls /testdir</span></span><br><span class="line">20/06/08 22:14:24 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs  -ls /</span></span><br><span class="line">20/06/08 22:14:32 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">Found 2 items</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:03 /hello.txt</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:13 /testdir</span><br><span class="line">root@brave-post-2:~/data<span class="comment">#</span></span><br></pre></td></tr></table></figure></div>

<ul>
<li>递归创建目录 <code>-p</code> 参数</li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -mkdir /a/b</span></span><br><span class="line">20/06/08 22:17:12 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">mkdir: `/a/b<span class="string">': No such file or directory</span></span><br><span class="line"><span class="string">root@brave-post-2:~/data# hadoop fs -mkdir -p /a/b</span></span><br><span class="line"><span class="string">20/06/08 22:17:26 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable</span></span><br><span class="line"><span class="string">root@brave-post-2:~/data# hadoop fs  -ls /</span></span><br><span class="line"><span class="string">20/06/08 22:17:53 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable</span></span><br><span class="line"><span class="string">Found 3 items</span></span><br><span class="line"><span class="string">drwxr-xr-x   - root supergroup          0 2020-06-08 22:17 /a</span></span><br><span class="line"><span class="string">-rw-r--r--   1 root supergroup         40 2020-06-08 22:03 /hello.txt</span></span><br><span class="line"><span class="string">drwxr-xr-x   - root supergroup          0 2020-06-08 22:13 /testdir</span></span><br></pre></td></tr></table></figure></div>

<ul>
<li>递归列出所有目录和文件 <code>-R</code> 参数</li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs  -ls -R /</span></span><br><span class="line">20/06/08 22:18:18 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:17 /a</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:17 /a/b</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:03 /hello.txt</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:13 /testdir</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs  -lsr /  #或者lsr命令</span></span><br><span class="line">lsr: DEPRECATED: Please use <span class="string">'ls -R'</span> instead.</span><br><span class="line">20/06/08 22:18:40 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:17 /a</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:17 /a/b</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:03 /hello.txt</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:13 /testdir</span><br><span class="line">root@brave-post-2:~/data<span class="comment">#</span></span><br></pre></td></tr></table></figure></div>

<ul>
<li>从本地拷贝 <code>copyFromLocal</code></li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -copyFromLocal hello.txt /a/b/h.txt</span></span><br><span class="line">20/06/08 22:25:06 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs  -ls -R /</span></span><br><span class="line">20/06/08 22:25:18 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:17 /a</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:25 /a/b</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:25 /a/b/h.txt</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:03 /hello.txt</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:13 /testdir</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -cat /a/b/h.txt</span></span><br><span class="line">20/06/08 22:26:07 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">hadoop welcome</span><br><span class="line">hadoop hdfs</span><br><span class="line">hadoop hello</span><br></pre></td></tr></table></figure></div>

<ul>
<li>从HDFS获取文件 <code>get</code></li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># ls</span></span><br><span class="line">hello.txt</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -get /a/b/h.txt</span></span><br><span class="line">20/06/08 22:27:09 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># ls</span></span><br><span class="line">hello.txt  h.txt</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># cat h.txt</span></span><br><span class="line">hadoop welcome</span><br><span class="line">hadoop hdfs</span><br><span class="line">hadoop hello</span><br></pre></td></tr></table></figure></div>

<ul>
<li>删除文件 <code>rm</code></li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -rm /hello.txt</span></span><br><span class="line">20/06/08 22:28:16 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">Deleted /hello.txt</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -ls /</span></span><br><span class="line">20/06/08 22:28:37 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">Found 2 items</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:17 /a</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:13 /testdir</span><br></pre></td></tr></table></figure></div>

<ul>
<li>从本地 <code>put</code> 文件至HDFS</li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -put hello.txt /</span></span><br><span class="line">20/06/08 22:29:36 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># ls -lh /root/software/hadoop-2.6.0-cdh5.7.0.tar.gz</span></span><br><span class="line">-rw-r--r-- 1 root root 298M Feb 20  2018 /root/software/hadoop-2.6.0-cdh5.7.0.tar.gz</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -put /root/software/hadoop-2.6.0-cdh5.7.0.tar.gz /</span></span><br><span class="line">20/06/08 22:33:27 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -ls -R /</span></span><br><span class="line">20/06/08 22:33:59 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:17 /a</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:25 /a/b</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:25 /a/b/h.txt</span><br><span class="line">-rw-r--r--   1 root supergroup  311585484 2020-06-08 22:33 /hadoop-2.6.0-cdh5.7.0.tar.gz</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:29 /hello.txt</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:13 /testdir</span><br></pre></td></tr></table></figure></div>

<ul>
<li>文件大小以GB、MB为单位显示而不是直接显示字节数 <code>-h</code> 参数</li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -ls -R -h /</span></span><br><span class="line">20/06/08 22:51:11 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:17 /a</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:25 /a/b</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:25 /a/b/h.txt</span><br><span class="line">-rw-r--r--   1 root supergroup    297.2 M 2020-06-08 22:33 /hadoop-2.6.0-cdh5.7.0.tar.gz</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:29 /hello.txt</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 22:13 /testdir</span><br><span class="line">root@brave-post-2:~/data<span class="comment">#</span></span><br></pre></td></tr></table></figure></div>

<ul>
<li>删除文件夹 <code>rmdir</code></li>
</ul>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="false"data-rel="BASH"><figure class="iseeu highlight /bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -mkdir -p /a/b/c</span></span><br><span class="line">20/06/08 23:27:22 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -ls -R -h /a/</span></span><br><span class="line">20/06/08 23:27:40 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 23:27 /a/b</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 23:27 /a/b/c</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:25 /a/b/h.txt</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -rmdir /a/b/c</span></span><br><span class="line">20/06/08 23:27:51 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">root@brave-post-2:~/data<span class="comment"># hadoop fs -ls -R -h /a/</span></span><br><span class="line">20/06/08 23:27:58 WARN util.NativeCodeLoader: Unable to load native-hadoop library <span class="keyword">for</span> your platform... using <span class="built_in">builtin</span>-java classes <span class="built_in">where</span> applicable</span><br><span class="line">drwxr-xr-x   - root supergroup          0 2020-06-08 23:27 /a/b</span><br><span class="line">-rw-r--r--   1 root supergroup         40 2020-06-08 22:25 /a/b/h.txt</span><br><span class="line">root@brave-post-2:~/data<span class="comment">#</span></span><br></pre></td></tr></table></figure></div>

<hr>
<h3 id="3-6-HDFS-Web-管理页面"><a href="#3-6-HDFS-Web-管理页面" class="headerlink" title="3.6. HDFS Web 管理页面"></a>3.6. HDFS Web 管理页面</h3><p>URL：<a href="http://23.105.206.170:50070/explorer.html#/" target="_blank" rel="noopener">http://23.105.206.170:50070/explorer.html#/</a></p>
<ul>
<li>浏览HDFS文件系统目录，查看文件信息</li>
</ul>
<p><img src="/2020/06/08/CDH-Hadoop%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B/hdfs01.png" alt="浏览HDFS文件系统目录"></p>
<hr>
<ul>
<li>查看block信息</li>
</ul>
<p><img src="/2020/06/08/CDH-Hadoop%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B/hdfs02.png" alt="查看文件block信息"></p>
<hr>
<h2 id="4-参考文档"><a href="#4-参考文档" class="headerlink" title="4. 参考文档"></a>4. 参考文档</h2><ul>
<li><a href="https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html" target="_blank" rel="noopener">https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html</a></li>
<li><a href="https://archive.cloudera.com/cdh5/cdh/5/hadoop-2.6.0-cdh5.7.0/hadoop-project-dist/hadoop-common/SingleCluster.html" target="_blank" rel="noopener">https://archive.cloudera.com/cdh5/cdh/5/hadoop-2.6.0-cdh5.7.0/hadoop-project-dist/hadoop-common/SingleCluster.html</a></li>
<li><a href="https://www.youtube.com/watch?v=k3Bb0fVVTZk&amp;list=PLhXu26RzZZTzveyPX8XgTBKf3tjxjA1tW&amp;index=3" target="_blank" rel="noopener">https://www.youtube.com/watch?v=k3Bb0fVVTZk&amp;list=PLhXu26RzZZTzveyPX8XgTBKf3tjxjA1tW&amp;index=3</a></li>
</ul>
<hr>

          
      
    </div>
    
    
      <footer class="article-footer">
        完
      </footer>
    
  </div>
  
    
<nav id="article-nav">
  <div class="article-nav-block">
    
      <a href="../../18/Hadoop-HDFS-JAVA-API%E6%93%8D%E4%BD%9C/" id="article-nav-newer" class="article-nav-link-wrap">
        <strong class="article-nav-caption"></strong>
        <div class="article-nav-title">
          
            Hadoop HDFS JAVA API操作
          
        </div>
      </a>
    
  </div>
  <div class="article-nav-block">
    
  </div>
</nav>

    <!-- <link rel="stylesheet" href="/css/gitment.css">  -->
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>

<div id="vcommentsContainer"></div>
<!--引用评论框输入特效js文件-->

<script src="../../../../js/shuru.js"></script>

<script>
  POWERMODE.colorful = true; // make power mode colorful
  POWERMODE.shake = true; // turn off shake
  document.body.addEventListener('input', POWERMODE);
</script>
<!-- valine评论系统 -->
<script>
  new Valine({
      el: '#vcommentsContainer',
      appId: 'AttjBiS7UwxkxjV1CSrNywoi-gzGzoHsz',
      appKey: 'F50aWycFFmAPLC8CfSW7rXdP',
      avatar: 'monsterid',
      enableQQ: true,
      placeholder: '昵称处填QQ号自动抓取网名和邮箱哟~'
  })
</script>


    <!-- <link rel="stylesheet" href="/css/gitment.css"> 
<script src="/js/gitment.js"></script>

<div id="gitmentContainer"></div>

<script>
var gitment = new Gitment({
  owner: '',
  repo: '',
  oauth: {
    client_id: '',
    client_secret: '',
  },
})
gitment.render('gitmentContainer')
</script>

 -->

  
  
</article>
</section>
        <aside id="sidebar">
  
    <div class="widget-box">
  <div class="avatar-box">
    <img class="avatar" src="https://q1.qlogo.cn/g?b=qq&amp;nk=979727728&amp;s=640" title="图片来自QQ"></img>
    <h3 class="avatar-name">
      
        许嵩老公
      
    </h3>
    <p class="avatar-slogan">
      深吸一口梦，吹个气球存起来。
    </p>
  </div>
</div>


  
    

  
    
  <div class="widget-box">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/NET/" rel="tag">.NET</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Cookie/" rel="tag">Cookie</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/ES6/" rel="tag">ES6</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Git-Bash/" rel="tag">Git Bash</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Github/" rel="tag">Github</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Github-Actions/" rel="tag">Github Actions</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/HDFS/" rel="tag">HDFS</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/HTTP/" rel="tag">HTTP</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Hadoop/" rel="tag">Hadoop</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Hexo/" rel="tag">Hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Idea/" rel="tag">Idea</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/JVM/" rel="tag">JVM</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Java/" rel="tag">Java</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/JavaScript/" rel="tag">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Linux/" rel="tag">Linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/MapReduce/" rel="tag">MapReduce</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Markdown/" rel="tag">Markdown</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Maven/" rel="tag">Maven</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Node/" rel="tag">Node</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Node-js/" rel="tag">Node.js</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/SQL/" rel="tag">SQL</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Serial-Port/" rel="tag">Serial Port</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Shell/" rel="tag">Shell</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/SpringBoot/" rel="tag">SpringBoot</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/TCP/" rel="tag">TCP</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/VSCode/" rel="tag">VSCode</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Vue/" rel="tag">Vue</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/WebSocket/" rel="tag">WebSocket</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/YARN/" rel="tag">YARN</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/hexo/" rel="tag">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/macOS/" rel="tag">macOS</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/ssh/" rel="tag">ssh</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81/" rel="tag">中文乱码</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%A4%A7%E6%95%B0%E6%8D%AE/" rel="tag">大数据</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/" rel="tag">安装教程</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%AF%86%E9%92%A5/" rel="tag">密钥</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%B9%B6%E8%A1%8C%E7%BC%96%E7%A8%8B/" rel="tag">并行编程</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%94%B5%E8%84%91/" rel="tag">电脑</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%AB%B9%E4%BA%91/" rel="tag">竹云</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%BB%88%E7%AB%AF/" rel="tag">终端</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E8%84%9A%E6%9C%AC/" rel="tag">脚本</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E8%BD%AC%E8%BD%BD/" rel="tag">转载</a></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E8%BD%AF%E4%BB%B6/" rel="tag">软件</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="../../../../tags/NET/" style="font-size: 10px;">.NET</a> <a href="../../../../tags/Cookie/" style="font-size: 10px;">Cookie</a> <a href="../../../../tags/ES6/" style="font-size: 10px;">ES6</a> <a href="../../../../tags/Git-Bash/" style="font-size: 11.67px;">Git Bash</a> <a href="../../../../tags/Github/" style="font-size: 13.33px;">Github</a> <a href="../../../../tags/Github-Actions/" style="font-size: 10px;">Github Actions</a> <a href="../../../../tags/HDFS/" style="font-size: 10px;">HDFS</a> <a href="../../../../tags/HTTP/" style="font-size: 11.67px;">HTTP</a> <a href="../../../../tags/Hadoop/" style="font-size: 18.33px;">Hadoop</a> <a href="../../../../tags/Hexo/" style="font-size: 10px;">Hexo</a> <a href="../../../../tags/Idea/" style="font-size: 10px;">Idea</a> <a href="../../../../tags/JVM/" style="font-size: 18.33px;">JVM</a> <a href="../../../../tags/Java/" style="font-size: 20px;">Java</a> <a href="../../../../tags/JavaScript/" style="font-size: 16.67px;">JavaScript</a> <a href="../../../../tags/Linux/" style="font-size: 15px;">Linux</a> <a href="../../../../tags/MapReduce/" style="font-size: 11.67px;">MapReduce</a> <a href="../../../../tags/Markdown/" style="font-size: 10px;">Markdown</a> <a href="../../../../tags/Maven/" style="font-size: 13.33px;">Maven</a> <a href="../../../../tags/Node/" style="font-size: 10px;">Node</a> <a href="../../../../tags/Node-js/" style="font-size: 10px;">Node.js</a> <a href="../../../../tags/SQL/" style="font-size: 13.33px;">SQL</a> <a href="../../../../tags/Serial-Port/" style="font-size: 10px;">Serial Port</a> <a href="../../../../tags/Shell/" style="font-size: 11.67px;">Shell</a> <a href="../../../../tags/SpringBoot/" style="font-size: 10px;">SpringBoot</a> <a href="../../../../tags/TCP/" style="font-size: 10px;">TCP</a> <a href="../../../../tags/VSCode/" style="font-size: 10px;">VSCode</a> <a href="../../../../tags/Vue/" style="font-size: 10px;">Vue</a> <a href="../../../../tags/WebSocket/" style="font-size: 11.67px;">WebSocket</a> <a href="../../../../tags/YARN/" style="font-size: 10px;">YARN</a> <a href="../../../../tags/hexo/" style="font-size: 11.67px;">hexo</a> <a href="../../../../tags/macOS/" style="font-size: 11.67px;">macOS</a> <a href="../../../../tags/ssh/" style="font-size: 11.67px;">ssh</a> <a href="../../../../tags/%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81/" style="font-size: 10px;">中文乱码</a> <a href="../../../../tags/%E5%A4%A7%E6%95%B0%E6%8D%AE/" style="font-size: 10px;">大数据</a> <a href="../../../../tags/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/" style="font-size: 10px;">安装教程</a> <a href="../../../../tags/%E5%AF%86%E9%92%A5/" style="font-size: 10px;">密钥</a> <a href="../../../../tags/%E5%B9%B6%E8%A1%8C%E7%BC%96%E7%A8%8B/" style="font-size: 10px;">并行编程</a> <a href="../../../../tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" style="font-size: 10px;">数据库</a> <a href="../../../../tags/%E7%94%B5%E8%84%91/" style="font-size: 11.67px;">电脑</a> <a href="../../../../tags/%E7%AB%B9%E4%BA%91/" style="font-size: 11.67px;">竹云</a> <a href="../../../../tags/%E7%BB%88%E7%AB%AF/" style="font-size: 13.33px;">终端</a> <a href="../../../../tags/%E8%84%9A%E6%9C%AC/" style="font-size: 10px;">脚本</a> <a href="../../../../tags/%E8%BD%AC%E8%BD%BD/" style="font-size: 10px;">转载</a> <a href="../../../../tags/%E8%BD%AF%E4%BB%B6/" style="font-size: 10px;">软件</a>
    </div>
  </div>

  
    
  <div class="widget-box">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2023/02/">二月 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2023/01/">一月 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2022/11/">十一月 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2022/09/">九月 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2022/08/">八月 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2021/12/">十二月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2021/02/">二月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2021/01/">一月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/08/">八月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/07/">七月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/06/">六月 2020</a></li></ul>
    </div>
  </div>

  
    
  <div class="widget-box">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="../../../../2023/02/13/%E4%BD%BF%E7%94%A8Node-js%E5%90%8E%E5%8F%B0%E8%AF%BB%E5%8F%96%E4%B8%B2%E5%8F%A3%E6%95%B0%E6%8D%AE%E5%B9%B6%E9%80%9A%E8%BF%87WebSocket%E5%AE%9E%E6%97%B6%E6%98%BE%E7%A4%BA%E5%9C%A8%E7%BD%91%E9%A1%B5%E4%B8%8A/">使用Node.js后台读取串口数据并通过WebSocket实时显示在网页上</a>
          </li>
        
          <li>
            <a href="../../../../2023/02/09/%E4%BD%9C%E4%B8%BA%E7%94%A8%E6%88%B7%EF%BC%8C%E4%BF%AE%E6%94%B9Cookie%E6%9C%89%E6%95%88%E6%9C%9F%EF%BC%8C%E5%BB%B6%E9%95%BFCookie%E6%9C%9F%E9%99%90/">作为用户，修改Cookie有效期，延长Cookie期限</a>
          </li>
        
          <li>
            <a href="../../../../2023/02/08/%E7%BB%88%E7%AB%AF%E5%91%BD%E4%BB%A4%E4%BB%A3%E7%90%86/">终端命令网络设置</a>
          </li>
        
          <li>
            <a href="../../../../2023/01/18/Windows%E7%B3%BB%E7%BB%9FC%E7%9B%98%E6%B8%85%E7%90%86%E5%B7%A5%E5%85%B7FreeMove%E5%8F%8A%E6%96%87%E4%BB%B6%E5%8D%A0%E7%94%A8%E8%BF%9B%E7%A8%8B%E6%9F%A5%E7%9C%8B%E8%BD%AF%E4%BB%B6LockHunter%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8/">Windows系统C盘清理工具FreeMove及文件占用进程查看软件LockHunter配合使用</a>
          </li>
        
          <li>
            <a href="../../../../2023/01/14/AutoReconnectWiFi/">检测断网自动重连WiFi脚本</a>
          </li>
        
      </ul>
    </div>
  </div>

  
      <div class="widget-box">
    <h3 class="widget-title">友链</h3>
    <div class="widget">
      
        <!-- <a style="display: block;" href="../../../../https:/xiaoyan94.github.io/" title target='_blank' -->
        <a style="display: block;" href="https://xiaoyan94.github.io/" title target='_blank'
        >Github Pages</a>
      
        <!-- <a style="display: block;" href="../../../../https:/xy94.gitee.io/" title target='_blank' -->
        <a style="display: block;" href="https://xy94.gitee.io/" title target='_blank'
        >Gitee Pages</a>
      
    </div>
  </div>

  
 
  
</aside>
      </div>
      <footer id="footer">
  <div class="foot-box global-width center">
    &copy; 2023 许嵩老公 &nbsp;&nbsp;
    Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    &nbsp;|&nbsp;主题 <a href="https://github.com/yiluyanxia/hexo-theme-antiquity" target="_blank" rel="noopener">antiquity</a>
    <br>
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span id="busuanzi_container_site_pv">不蒜子告之   阁下是第<span id="busuanzi_value_site_pv"></span>个访客</span>
    
  </div>
  
  <!--引入文字点击特效-->
  <script src="https://code.jquery.com/jquery-2.0.3.min.js"></script>
  
<script src="../../../../js/dianji.js"></script>

</footer>

<!--添加回到顶部按钮-->
<style>
/* 小猫置顶 */
/* 自定义回到顶部样式 */
.cd-top {
  position: fixed;
  right: 25px;
  top: -900px;
  z-index: 99;
  width: 70px;
  height: 900px;
  /* background: url(https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.9/img/Sakura/images/scroll.png) no-repeat center; */
  background: url(/images/scroll.png) no-repeat center;
  background-size: contain;
  -webkit-transition: all .5s ease-in-out;
  transition: all .5s ease-in-out;
  /* cursor: url(https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.9/img/Sakura/cursor/No_Disponible.cur), auto; */
  cursor: url(/images/cursor/No_Disponible.cur), auto;
  opacity: 1
}

.cd-top.cd-is-visible {
  opacity: 1;
  top: -326px
}

.cd-top.cd-fade-out {
  opacity: 1
}

.cd-top:hover {
  opacity: 1
}

.cd-top span {
  display: none;
  color: #000;
  position: absolute;
  bottom: 0;
  height: 20px;
  width: 50px;
  text-align: center
}

@media screen and (max-width:860px) {
  .cd-top {
      display: none;
      height: 60px;
      width: 50px
  }
  .cd-top span {
      height: 10px;
      width: 50px
  }
}

#moblieGoTop {
  display: none;
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 99;
  border: 0;
  outline: 0;
  background-color: #fff;
  color: #404040;
  cursor: pointer;
  padding: 15px;
  border-radius: 10px;
  border-radius: 12px;
  box-shadow: 0 0 2px 0 rgba(0, 0, 0, .12), 0 2px 2px 0 rgba(0, 0, 0, .24);
  transition: box-shadow .2s ease
}
#moblieGoTop:hover {
  background-color: #fff;
  opacity: .8
}
.changeSkin-gear {
  position: fixed;
  bottom: 0;
  left: auto;
  right: 5px;
  width: auto;
  height: auto;
  z-index: 99;
  white-space: nowrap;
  padding: 10px 10px;
  cursor: pointer;
  border-radius: 10px 10px 0 0
}
</style>

<!-- 添加小猫置顶 -->
<a class="cd-top faa-float animated cd-is-visible cd-fade-out" style="top: -500px;"></a>
<button id="moblieGoTop" title="Go to top" style="display: none;font-size: xx-large;"><i class="fa fa-chevron-up" aria-hidden="true"></i>🔝</button>

<!-- <div class="scroll "> <i class="fa fa-arrow-up" style="margin-left: 4px;"></i>
Top⬆️
<span class="scrollpercent" style="margin-left: -2px;"></span>
<span style="margin-right: 4px; margin-left: -4px;">%</span>
</div> -->

<!-- https://www.huangpinke.com/2018/08/24/add-back-to-top-button.html -->
      <script src="https://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
if (!window.jQuery) {
var script = document.createElement('script');
script.src = "/js/jquery-2.0.3.min.js";
document.body.write(script);
}
</script>

  
<link rel="stylesheet" href="../../../../fancybox/jquery.fancybox.css">

  
<script src="../../../../fancybox/jquery.fancybox.pack.js"></script>




<script src="../../../../js/script.js"></script>




<script>
  (function(){
      var bp = document.createElement('script');
      bp.src = '//push.zhanzhang.baidu.com/push.js';
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
  })();
  </script>

<!-- mermaid图 -->

  <script src='https://unpkg.com/mermaid@7.1.2/dist/mermaid.min.js'></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize({theme: 'forest'});
    }
  </script>

    </div>
    <nav id="mobile-nav" class="mobile-nav-box">
  <div class="mobile-nav-img mobile-nav-top"></div>
  
    <a href="../../../../index.html" class="mobile-nav-link">首页</a>
  
    <a href="../../../../archives" class="mobile-nav-link">归档</a>
  
    <a href="../../../../quick-notes" class="mobile-nav-link">小抄</a>
  
    <a href="../../../../about" class="mobile-nav-link">关于</a>
  
  <div class="mobile-nav-img  mobile-nav-bottom"></div>
</nav>    
  </div>
</body>

</html>